<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Renames a file or directory</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="streamwrapper.mkdir.html">streamWrapper::mkdir</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="streamwrapper.rmdir.html">streamWrapper::rmdir</a></div>
 <div class="up"><a href="class.streamwrapper.html">streamWrapper</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="streamwrapper.rename" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">streamWrapper::rename</h1>
  <p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">streamWrapper::rename</span> &mdash; <span class="dc-title">Renames a file or directory</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-streamwrapper.rename-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span> <span class="methodname"><strong>streamWrapper::rename</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$path_from</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$path_to</code></span>
   )</div>

  <p class="para rdfs-comment">
   This method is called in response to <span class="function"><a href="function.rename.html" class="function">rename()</a></span>.
  </p>
  <p class="para">
   Should attempt to rename <em><code class="parameter">path_from</code></em> to
   <em><code class="parameter">path_to</code></em>
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    In order for the appropriate error message to be returned this method
    should <em class="emphasis">not</em> be defined if the wrapper does not support
    renaming files.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-streamwrapper.rename-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">path_from</code></em></dt>

     <dd>

      <p class="para">
       The URL to the current file.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">path_to</code></em></dt>

     <dd>

      <p class="para">
       The URL which the <em><code class="parameter">path_from</code></em> should be renamed to.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-streamwrapper.rename-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>TRUE</code></strong>， 或者在失败时返回 <strong><code>FALSE</code></strong>。
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-streamwrapper.rename-errors">
  <h3 class="title">错误／异常</h3>
  <p class="para">调用此方法失败将给出
<strong><code>E_WARNING</code></strong>（未实现）。</p>
 </div>

 


 <div class="refsect1 notes" id="refsect1-streamwrapper.rename-notes">
  <h3 class="title">注释</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para">当合法的上下文传递给调用函数时，属性
<var class="varname"><var class="varname">streamWrapper::$context</var></var>
会被改变。</p></p></blockquote>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-streamwrapper.rename-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.rename.html" class="function" rel="rdfs-seeAlso">rename()</a> - 重命名一个文件或目录</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="streamwrapper.mkdir.html">streamWrapper::mkdir</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="streamwrapper.rmdir.html">streamWrapper::rmdir</a></div>
 <div class="up"><a href="class.streamwrapper.html">streamWrapper</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
